<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>JDialog 插件测试</title>

	<!--<script language="javascript" charset="utf-8" src="dist/JDialog.min.js" ></script>-->
	<script language="javascript" charset="utf-8" src="src/jquery-1.11.2.min.js" ></script>
	<script language="javascript" charset="utf-8" src="src/JDialog.js" ></script>
</head>

<body>
<div class="container">



	<h3>JDialog.msg</h3>
	<div>
		<button class="btn btn-success" onclick="tipsuccess();">成功（SUCCESS）</button>
		<button class="btn btn-info" onclick="tipinfo();">一般信息（INFO）</button>
		<button class="btn btn-danger" onclick="tiperror();">错误信息（ERROR）</button>
		<button class="btn btn-warning" onclick="tiploading();">加载等待（LOADING）</button>
	</div>




	<h3>JDialog.alert</h3>
	<div>
		<button class="btn btn-primary" onclick="__alert();">弹出Alert</button>
	</div>

	<h3>JDialog.confirm</h3>
	<div>
		<button class="btn btn-primary" onclick="popConfirm();">弹出确认对话框</button>
	</div>




</div>

<script language="javascript">

	var __offset = ['cc', 'lt', 'tc', 'rt', 'lc', 'rc', 'lb', 'bc', 'rb'];
	var __effect = ['zoomIn', 'zoomInDown', 'bounceInDown', 'shake', 'flip', 'slideInDown'];
	var __icons = ['warn','ok','edit','bag','ask','minus','italic','unlock','smile','angry','down','remove','msg','mail'];

	//锁定屏幕
	function lockScreen() {
		JDialog.lock({timer : 2000});
	}

	function tipsuccess() {
		JDialog.msg({
			type:'ok',
			content : '恭喜您，注册成功，即将跳转至登录界面',
			lock : false,
            offset : 'cc',
            effect :'zoomIn',
		});
	}

	function tipinfo() {
		//JDialog.msg("你好，我是默认提示样式");
		JDialog.msg({
			type:'warn',
			content : '一般提示信息',
            offset : 'cc',
            effect :'zoomIn',
		});
	}

	function tiperror() {
		JDialog.msg({type:'error', content : '对不起，注册失败，请重试', effect :'zoomIn', offset:'tc'});
	}

	function tiploading() {
		JDialog.msg({type:'loading',  content : '正在努力加载数据，请稍后...', lock : true, effect :'zoomIn',});
	}




	function __alert() {
		JDialog.alert({
			title : '提示标题',
			content : '你好，您的提现已经成功。',
			/*icon : "	loader-icon-3",*/
		});
	}

	function popConfirm() {

		var win = JDialog.confirm({
			title : "对话框标题",
			width : 600,
			lock : false,
			effect : 1,
//		maxEnable : true,
			content : '该操作会删除所有的商品，继续操作吗？强烈建议您将其移动至其他栏目.',
			//icon : __icons[Math.floor(Math.random() * __icons.length)],
            offset : 'cc',
            effect :'zoomIn',

			button : {
				'确认' : function(dialog) {
					dialog.lock();
					setTimeout(function() {
					JDialog.msg({
							type:"ok",
							content:"处理成功.",
							container:"#"+win.getId(),
							timer:1000,
							callback: function() {
								dialog.close();
							}
						});

					}, 2000)
				},
				'取消' : function(dialog) {
					JDialog.msg({type:'error', content : 'fuck ,  你为什么要取消！！', container : ".jdialog_win_box", timer : 2000});
				}
			}
		});
	}



</script>
</body>

</html>

